package com.eshin.listener;

import javax.management.AttributeChangeNotification;
import javax.management.Notification;
import javax.management.NotificationFilter;
import javax.management.NotificationListener;
/**
 * jmx消息监听
 * @author Eshin
 *
 */
public class NoticeListener implements NotificationListener, NotificationFilter {

	/**
	 * 
	 */
	private static final long serialVersionUID = -986858949933136131L;

	@Override
	public boolean isNotificationEnabled(Notification notification) {
		// TODO Auto-generated method stub
		return AttributeChangeNotification.class.isAssignableFrom(notification.getClass());
	}

	@Override
	public void handleNotification(Notification notification, Object handback) {
		// TODO Auto-generated method stub
		System.out.println(notification);
//		System.out.println(notification.getUserData());
//		System.out.println(notification.getSource());
		System.out.println(notification.getMessage());
	}

}
